from django.urls import path
from django.shortcuts import redirect
from . import views

def root_redirect(request):
    """根路径重定向到首页"""
    return redirect('/index/')

app_name = 'create'
urlpatterns = [
    path('', root_redirect),  # 根路径重定向到/index/
    path('index/', views.index_view, name='index'),  # 首页使用index路径
    path('generate/', views.generate_view, name='generate'),
    path('story/<int:story_id>/', views.story_detail_view, name='detail'),
]